var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var foo = function () { }; // []  {}
var bar = { foo: 123, baz: '123' };
var arr = [1, 2, 3];
// const arr: string[] = ['foo', 'bar', 'baz'];
function sum() {
    var args = [];
    for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
    }
    return args.reduce(function (acc, current) { return acc + current; }, 0);
}
console.log(sum.apply(void 0, arr));
// const tuple: [string, number] = ['123', 12, 123]
var obj = {
    foo: 'foo',
    bar: 123
};
// console.log(Object.entries(obj));
var STATUS = {
    SUCCESS: 1,
    FAILED: 0,
    DOING: 2
};
function fun(a, b) {
    return a + b;
}
var fun1 = function (a, b) {
    return a + b;
};
function stringify(value) {
    return JSON.stringify(value);
}
function printPost(post) {
    console.log(post.title);
    console.log(post.content);
    console.log(post.share);
}
var a = {};
a.foo = 'foo';
a.bar = '100';
var Person = /** @class */ (function () {
    function Person() {
    }
    Person.prototype.eat = function (food) {
        console.log("\u4F18\u96C5\u7684\u5403: " + food);
    };
    Person.prototype.run = function (distance) {
        console.log("\u884C\u8D70\uFF1A" + distance);
    };
    return Person;
}());
// class Animal implements EatAndRun{
//   eat(food: string): void{
//     console.log(`咕噜咕噜的吃: ${food}`);
//   }
//   run(distance: number): void{
//     console.log(`爬行：${distance}`);
//   }
// }
var Animal = /** @class */ (function () {
    function Animal() {
    }
    Animal.prototype.eat = function (food) {
        console.log("\u4F18\u96C5\u7684\u5403: " + food);
    };
    return Animal;
}());
var Dog = /** @class */ (function (_super) {
    __extends(Dog, _super);
    function Dog() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Dog.prototype.run = function (distance) {
        console.log("\u722C\u884C\uFF1A" + distance);
    };
    return Dog;
}(Animal));
var dog = new Dog();
dog.eat('狗粮');
dog.run(10000);




var a = [];
for(var i = 0; i < 10; i++){
	a[i] = function(){
  	console.log(i)
  }
}
a[6]();